import request from '@/utils/request'
//  编辑价格
export const UpdatePrice = data => request.post('/api/v1/SysBusinessDetectionItem/SingleUpdate', data);
//  批量编辑价格
export const BeatchUpdatePrice = data => request.post('/api/v1/SysBusinessDetectionItem/BeatchUpdatePrice', data);
//  导出
export const getExportList = data => request.get('/api/v1/SysBusinessDetectionItem/GetDetectionItemExportFile', data);
//  下载文件
export const DownloadEntrustOrderMaggess = params => request('/api/v1/SysBusinessDetectionItem/DownloadDetectionItem', { responseType: 'blob' });

// 导入委托单数据
export const ImportEntrustUrl = data => request.post('/api/v1/SysBusinessDetectionItem/ExcelImport', data);
// 下载委托单模板
export const DownloadEntrustOrderTemplate = params => request('/api/v1/SysBusinessDetectionItem/DownloadEntrustOrderTemplate', { params: params });

export function create(data) {
  return request({
    url: '/api/v1/SysBusinessDetectionItem/Create',
    method: 'post',
    data
  })
}
export function update(data) {
  return request({
    url: '/api/v1/SysBusinessDetectionItem/Update',
    method: 'post',
    data
  })
}
export function getList(data, pagination) {
  if (pagination) {
    data["pageIndex"] = pagination.pageIndex;
    data["pageSize"] = pagination.pageSize;
  }
  return request({
    url: '/api/v1/SysBusinessDetectionItem/GetList',
    method: 'get',
    params: data
  })
}

export function GetDetectionItemPriceList(data, pagination) {
  if (pagination) {
    data["pageIndex"] = pagination.pageIndex;
    data["pageSize"] = pagination.pageSize;
  }
  return request({
    url: '/api/v1/SysBusinessDetectionItem/GetDetectionItemPriceList',
    method: 'get',
    params: data
  })
}

